﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EscrowEditControl.ascx.cs"
    Inherits="LenderClearingHouse.EscrowEditControl" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<table>
    <tr>
        <td>
            <p>
                <strong>Common section</strong></p>
            <table>
                <tr>
                    <td>
                        Accept Date
                    </td>
                    <td>
                        <telerik:RadDateInput ID="edDataAccept" runat="server" DbSelectedDate='<%# DataBinder.Eval( Container, "DataItem.DateAccept") %>'
                            Enabled="False" ReadOnly="True">
                        </telerik:RadDateInput>
                    </td>
                </tr>
                <tr>
                    <td>
                        APN
                    </td>
                    <td>
                        <telerik:RadTextBox ID="edAPN" runat="server" Text='<%# DataBinder.Eval( Container, "DataItem.Apn") %>'
                            Enabled="False" ReadOnly="True" Width="200px">
                        </telerik:RadTextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Property Location
                    </td>
                    <td>
                        <telerik:RadTextBox ID="RadTextBox1" runat="server" Text='<%# DataBinder.Eval( Container, "DataItem.PropertyLocation") %>'
                            Enabled="False" ReadOnly="True" Width="200px">
                        </telerik:RadTextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        ZIP
                    </td>
                    <td>
                        <telerik:RadTextBox ID="RadTextBox2" runat="server" Text='<%# DataBinder.Eval( Container, "DataItem.ZipCode") %>'
                            Enabled="False" ReadOnly="True" Width="200px">
                        </telerik:RadTextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Investor
                    </td>
                    <td>
                        &nbsp;
                    </td>                    
                </tr>
                <tr>
                    <td>
                        Net Profit
                    </td>
                    <td>
                        <div style="cursor:pointer; background-color:Gray; font-weight: bold; color: White" id="div-net-profit" onclick="OpenNetSheetDialog();">
                            <%# ((decimal)DataBinder.Eval(Container, "DataItem.NetProfit")).ToString("c") %>
                        </div>
                    </td>
                </tr>
            </table>
            <p>
                <strong>Frontend Escrow</strong></p>
            <table>
                <tr>
                    <td>
                        Purchase Agreement<br/>Received
                    </td>
                    <td>
                        <telerik:RadDatePicker ID="edPurchaseAgreementReceived" runat="server" DbSelectedDate='<%# DataBinder.Eval( Container, "DataItem.PurchaseAgreementReceived") %>'>
                        </telerik:RadDatePicker>
                    </td>
                    <td>
                        Effective Date Bank
                    </td>
                    <td>
                        <telerik:RadDatePicker ID="edEffectiveDateBank" runat="server" DbSelectedDate='<%# DataBinder.Eval( Container, "DataItem.EffectiveDateBank") %>'>
                        </telerik:RadDatePicker>
                    </td>
                </tr>
                <tr>
                    <td>
                        CAP
                    </td>
                    <td>
                        <telerik:RadTextBox ID="edCAP" runat="server" Text='<%# DataBinder.Eval( Container, "DataItem.CAP") %>'>
                        </telerik:RadTextBox>
                    </td>
                    <td>
                        ECOE - F
                    </td>
                    <td>
                        <telerik:RadDatePicker ID="edECOE_F" runat="server" DbSelectedDate='<%# DataBinder.Eval( Container, "DataItem.ECOE_F") %>'>
                        </telerik:RadDatePicker>
                    </td>
                </tr>
                <tr>
                    <td>
                        Title Company
                    </td>
                    <td>
                        <telerik:RadTextBox ID="edTitleCompanyFront" runat="server" Text='<%# DataBinder.Eval( Container, "DataItem.TitleCompanyFront") %>'>
                        </telerik:RadTextBox>
                    </td>
                    <td>
                        Adj Purchase Price
                    </td>
                    <td>
                        <telerik:RadNumericTextBox ID="edAdjPurchasePrice" runat="server" DataType="System.Int32"
                            DbValue='<%# DataBinder.Eval( Container, "DataItem.AdjPurchasePrice") %>'>
                        </telerik:RadNumericTextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Loan
                    </td>
                    <td>
                        <telerik:RadTextBox ID="edLoan" runat="server" Text='<%# DataBinder.Eval( Container, "DataItem.Loan") %>'>
                        </telerik:RadTextBox>
                    </td>
                    <td>
                        RECORDED - F
                    </td>
                    <td>
                        <telerik:RadDatePicker ID="edRECORDED_F" runat="server" DbSelectedDate='<%# DataBinder.Eval( Container, "DataItem.RECORDED_F") %>' AutoPostBack="true">
                        </telerik:RadDatePicker>
                    </td>
                </tr>
                <tr>
                    <td>
                        Loan Info
                    </td>
                    <td>
                        <telerik:RadTextBox ID="edLoanInfo" runat="server" Text='<%# DataBinder.Eval( Container, "DataItem.LoanInfo") %>'>
                        </telerik:RadTextBox>
                    </td>
                    <td>
                        Comments
                    </td>
                    <td>
                        <textarea id="edCommentsFront" cols="20" name="S1" rows="2" runat="server"><%# DataBinder.Eval(Container, "DataItem.CommentsFront")%></textarea>
                    </td>
                </tr>
                <tr>
                    <td>
                        Purchase Price
                    </td>
                    <td>
                        <div id="div-purchase-price">
                            <%# Convert.ToDecimal(DataBinder.Eval(Container, "DataItem.PurchasePrice")).ToString("c")%>
                        </div>
                        <div id="div-buyer-purchase-value" style="display:none;">
                            <%# Convert.ToDecimal(DataBinder.Eval(Container, "DataItem.PurchasePrice")).ToString()%>
                        </div>
                    </td>
                    <td>
                    </td>
                    <td>
                    </td>
                </tr>
            </table>
        </td>
        <td>
            <p>
                <strong>Backend Escrow</strong></p>
            <table>
                <tr>
                    <td>
                        Listing<br/>Agreement
                    </td>
                    <td>
                        <telerik:RadDatePicker ID="edListingAgreement" runat="server" DbSelectedDate='<%# DataBinder.Eval( Container, "DataItem.ListingAgreement") %>'>
                        </telerik:RadDatePicker>
                    </td>
                    <td>
                        Comments
                    </td>
                    <td>
                        <textarea id="edCommentsBack" cols="20" name="S1" rows="2" runat="server"><%# DataBinder.Eval(Container, "DataItem.CommentsBack")%></textarea>
                    </td>
                </tr>
                <tr>
                    <td>
                        Contract Date
                    </td>
                    <td>
                        <telerik:RadDatePicker ID="edContractDate" runat="server" DbSelectedDate='<%# DataBinder.Eval( Container, "DataItem.ContractDate") %>'>
                        </telerik:RadDatePicker>
                    </td>
                    <td>
                        Buyer Sign
                    </td>
                    <td>
                        <telerik:RadDatePicker ID="edBuyerSign" runat="server" DbSelectedDate='<%# DataBinder.Eval( Container, "DataItem.BuyerSign") %>'>
                        </telerik:RadDatePicker>
                    </td>
                </tr>
                <tr>
                    <td>
                        ECOE - B
                    </td>
                    <td>
                        <telerik:RadDatePicker ID="edECOE_B" runat="server" DbSelectedDate='<%# DataBinder.Eval( Container, "DataItem.ECOE_B") %>'>
                        </telerik:RadDatePicker>
                    </td>
                    <td>
                        Seller Sign
                    </td>
                    <td>
                        <telerik:RadDatePicker ID="edSellerSign" runat="server" DbSelectedDate='<%# DataBinder.Eval( Container, "DataItem.SellerSign") %>'>
                        </telerik:RadDatePicker>
                    </td>
                </tr>
                <tr>
                    <td>
                        Recorded - B
                    </td>
                    <td>
                        <telerik:RadDatePicker ID="edRecorded_B" runat="server" DbSelectedDate='<%# DataBinder.Eval( Container, "DataItem.Recorded_B") %>'>
                        </telerik:RadDatePicker>
                    </td>
                    <td>
                        Doc&#39;s In
                    </td>
                    <td>
                        <telerik:RadDatePicker ID="edDocsIn" runat="server" DbSelectedDate='<%# DataBinder.Eval( Container, "DataItem.DocsIn") %>'>
                        </telerik:RadDatePicker>
                    </td>
                </tr>
                <tr>
                    <td>
                        Selling Price
                    </td>
                    <td>
                        <div id="div-buyer-purchase-price">
                            <%# Convert.ToDecimal(DataBinder.Eval(Container, "DataItem.BuyerPurchasePrice")).ToString("c")%>
                        </div>
                        <div id="div-buyer-purchase-price-value" style="display:none;">
                            <%# Convert.ToDecimal(DataBinder.Eval(Container, "DataItem.BuyerPurchasePrice")).ToString()%>
                        </div>
                        <div id="div-rehabcosts-value" style="display:none;">
                            <%# Convert.ToDecimal(DataBinder.Eval(Container, "DataItem.RehabCosts")).ToString()%>
                        </div>
                        <div id="div-propertyid" style="display:none;">
                            <%# Convert.ToInt64(DataBinder.Eval(Container, "DataItem.PropertyId")).ToString()%>
                        </div>
                    </td>
                    <td>
                        Walk Through
                    </td>
                    <td>
                        <telerik:RadDatePicker ID="edWalkThrough" runat="server" DbSelectedDate='<%# DataBinder.Eval( Container, "DataItem.WalkThrough") %>'>
                        </telerik:RadDatePicker>
                    </td>
                </tr>
                <tr>
                    <td>
                        Purchase Type
                    </td>
                    <td>
                        <telerik:RadTextBox ID="edPurchaseType" runat="server" Text='<%# DataBinder.Eval( Container, "DataItem.PurchaseType") %>'>
                        </telerik:RadTextBox>
                    </td>
                    <td>
                        Lender
                    </td>
                    <td>
                        <telerik:RadTextBox ID="edLender" runat="server" Text='<%# DataBinder.Eval( Container, "DataItem.Lender") %>'>
                        </telerik:RadTextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Incentive
                    </td>
                    <td>
                        <telerik:RadTextBox ID="edIncentive" runat="server" Text='<%# DataBinder.Eval( Container, "DataItem.Incentive") %>'>
                        </telerik:RadTextBox>
                    </td>
                    <td>
                        COOP Agent
                    </td>
                    <td>
                        <telerik:RadTextBox ID="edCOOPAgent" runat="server" Text='<%# DataBinder.Eval( Container, "DataItem.COOPAgent") %>'>
                        </telerik:RadTextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        HOA &amp;<br/>Management
                    </td>
                    <td>
                        <telerik:RadTextBox ID="edHOAManagement" runat="server" Text='<%# DataBinder.Eval( Container, "DataItem.HOAManagement") %>'>
                        </telerik:RadTextBox>
                    </td>
                    <td>
                        Buyer&#39;s Name
                    </td>
                    <td>
                        <telerik:RadTextBox ID="edBuyerName" runat="server" Text='<%# DataBinder.Eval( Container, "DataItem.BuyerName") %>'>
                        </telerik:RadTextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Monthly HOA<br/>Dues
                    </td>
                    <td>
                        <telerik:RadNumericTextBox ID="edMonthlyHOADues" runat="server" DbValue='<%# DataBinder.Eval( Container, "DataItem.MonthlyHOADues") %>'
                            DataType="System.Int32">
                        </telerik:RadNumericTextBox>
                    </td>
                    <td>
                        Title Company
                    </td>
                    <td>
                        <telerik:RadTextBox ID="edTitleCompanyBack" runat="server" Text='<%# DataBinder.Eval( Container, "DataItem.TitleCompanyBack") %>'>
                        </telerik:RadTextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Past due HOA
                    </td>
                    <td>
                        <telerik:RadTextBox ID="edPastDueHOA" runat="server" Text='<%# DataBinder.Eval( Container, "DataItem.PastDueHOA") %>'>
                        </telerik:RadTextBox>
                    </td>
                    <td>
                        Resale Pkg<br/>to Agent
                    </td>
                    <td>
                        <telerik:RadTextBox ID="edResalePkgToAgent" runat="server" Text='<%# DataBinder.Eval( Container, "DataItem.ResalePkgToAgent") %>'>
                        </telerik:RadTextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Resale Packet<br/>Ordered
                    </td>
                    <td>
                        <telerik:RadDatePicker ID="edResalePacketOrdered" runat="server" DbSelectedDate='<%# DataBinder.Eval( Container, "DataItem.ResalePacketOrdered") %>'>
                        </telerik:RadDatePicker>
                    </td>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>
<br />
<table>
    <tr>
        <td>
            <asp:Button ID="btnUpdate" Text="Update" runat="server" CommandName="Update" Visible='<%# !(DataItem is Telerik.Web.UI.GridInsertionObject) %>'>
            </asp:Button>
            <asp:Button ID="btnInsert" Text="Insert" runat="server" CommandName="PerformInsert"
                Visible='<%# DataItem is Telerik.Web.UI.GridInsertionObject %>'></asp:Button>
            &nbsp;
            <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
                CommandName="Cancel"></asp:Button>
        </td>
    </tr>
</table>
